//
//  ShouCangCell.m
//  SnailPost
//
//  Created by Liuiu on 16/3/16.
//  Copyright © 2016年 抠泥ser. All rights reserved.
//

#import "ShouCangCell.h"

@implementation ShouCangCell




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView NightWithType:UIViewColorTypeNormal];
        
        self.xian =[[UIView alloc]init];
        _xian.backgroundColor =[UIColor gainsboroColor];
        [self.contentView addSubview:_xian];
        
        
        self.image =[[UIImageView alloc]init];
//        _image .backgroundColor =[UIColor greenColor];
        [self.contentView addSubview:_image];
        
        
        
        self.title = [[UILabel alloc]init];
//        _title.backgroundColor = [UIColor redColor];
        _title.numberOfLines = 2;
        [_title NightWithType:UIViewColorTypeNormal];
        _title.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:_title];
        
        
        self.content = [[UILabel alloc]init];
        _content.textColor =[UIColor lightGrayColor];
        _content.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_content];
        
        
        self.bofang = [[UIImageView alloc]init];
        _bofang.image = [UIImage imageNamed:@"bofang"];
        [self.image addSubview:_bofang];
        
        self.time = [[UIImageView alloc]init];
        _time.image = [UIImage imageNamed:@"time"];
        [self.contentView addSubview:_time];
        
        
        self.times = [[UILabel alloc]init];
        _times.font = [UIFont systemFontOfSize:13];
//        _times.backgroundColor =[UIColor redColor];
        [_times NightWithType:UIViewColorTypeNormal];
        _time.alpha = 0.5;
        [self.contentView addSubview:_times];
        
        
        self.count = [[UIImageView alloc]init];
        _count.image =[UIImage imageNamed:@"bofang3"];
        [self.contentView addSubview:_count];
        
        
        self.counts =[[UILabel alloc]init];
//        _counts.backgroundColor = [UIColor cyanColor];
        [_counts NightWithType:UIViewColorTypeNormal];
        _counts.font = [UIFont systemFontOfSize:13];
        _counts.alpha = 0.5;
        [self.contentView addSubview:_counts];
        
       
    }
     return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
  
    //播放图标
    [_bofang mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.image);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    //播放图片
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
       make.edges.equalTo(self.contentView).width.insets(UIEdgeInsetsMake(5, 10, 5, self.contentView.frame.size.width -160));
    }];

    //标题
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).width.insets(UIEdgeInsetsMake(5, 175, 40, 10));
    }];
    
    [_time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(102,180, 8, 173 ));
    }];
    [_times mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(100, 205, 5, 125));
    }];
    [_count mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(102, 253, 8, 100));
    }];
    [_counts mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(100, 275, 5, 20));
    }];

    [_xian mas_makeConstraints:^(MASConstraintMaker *make) {
      make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(125, 0, 3, 0));
    }];
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
